package com.beiding.workordersystem.orders.generalorder.controller;

import com.beiding.workordersystem.common.dao.MPage;
import com.beiding.workordersystem.common.standard.R;
import com.beiding.workordersystem.orders.generalorder.service.GeneralOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/generalOrder/user")
public class UserGeneralOrderController {


    @Autowired
    private GeneralOrderService generalOrderService;

    //用户抢单
    @GetMapping("/grab")
    R grab(@RequestParam String orderId){
        generalOrderService.grab(orderId);
        return R.ok();
    }

    @GetMapping("/page/grab")
    R page(MPage mPage){
        return R.ok(generalOrderService.pageGrab(mPage));
    }

}
